/*
 * @(#)Vendor.java   13/08/13
 * 
 * Copyright (c) 2013 DieHard Development
 *
 * All rights reserved.
   Released under the BSD 3 clause license
Redistribution and use in source and binary forms, with or without modification, 
are permitted provided that the following conditions are met:

    Redistributions of source code must retain the above copyright notice, this 
    list of conditions and the following disclaimer. Redistributions in binary 
    form must reproduce the above copyright notice, this list of conditions and 
    the following disclaimer in the documentation and/or other materials 
    provided with the distribution. Neither the name of the DieHard Development 
    nor the names of its contributors may be used to endorse or promote products 
    derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 *
 *
 *
 */


/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
 */
package showtest;

//~--- JDK imports ------------------------------------------------------------

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author TJ
 */
@Entity
@Table(
    name = "VENDOR",
    catalog = "",
    schema = "APP"
)
@NamedQueries( {
    @NamedQuery(
        name = "Vendor.findAll",
        query = "SELECT v FROM Vendor v"
    ) , @NamedQuery(
        name = "Vendor.findByVendorid",
        query = "SELECT v FROM Vendor v WHERE v.vendorid = :vendorid"
    ) , @NamedQuery(
        name = "Vendor.findByVendor",
        query = "SELECT v FROM Vendor v WHERE v.vendor = :vendor"
    ) , @NamedQuery(
        name = "Vendor.findByContact",
        query = "SELECT v FROM Vendor v WHERE v.contact = :contact"
    ) , @NamedQuery(
        name = "Vendor.findByPhone",
        query = "SELECT v FROM Vendor v WHERE v.phone = :phone"
    ) , @NamedQuery(
        name = "Vendor.findByLotsize",
        query = "SELECT v FROM Vendor v WHERE v.lotsize = :lotsize"
    ) , @NamedQuery(
        name = "Vendor.findByDeposit",
        query = "SELECT v FROM Vendor v WHERE v.deposit = :deposit"
    ) , @NamedQuery(
        name = "Vendor.findByBalance",
        query = "SELECT v FROM Vendor v WHERE v.balance = :balance"
    )
})
public class Vendor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(
        name = "VENDORID",
        nullable = false
    )
    private Integer vendorid;
    @Column(
        name = "VENDOR",
        length = 100
    )
    private String vendor;
    @Column(
        name = "CONTACT",
        length = 50
    )
    private String contact;
    @Column(
        name = "PHONE",
        length = 10
    )
    private String phone;
    @Column(
        name = "LOTSIZE",
        length = 100
    )
    private String lotsize;
    @Column(
        name = "DEPOSIT",
        length = 10
    )
    private String deposit;
    @Column(
        name = "BALANCE",
        length = 10
    )
    private String balance;

    /**
     * Constructs ...
     *
     */
    public Vendor() {}

    /**
     * Constructs ...
     *
     *
     * @param vendorid
     */
    public Vendor(Integer vendorid) {
        this.vendorid = vendorid;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public Integer getVendorid() {
        return vendorid;
    }

    /**
     * Method description
     *
     *
     * @param vendorid
     */
    public void setVendorid(Integer vendorid) {
        this.vendorid = vendorid;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getVendor() {
        return vendor;
    }

    /**
     * Method description
     *
     *
     * @param vendor
     */
    public void setVendor(String vendor) {
        this.vendor = vendor;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getContact() {
        return contact;
    }

    /**
     * Method description
     *
     *
     * @param contact
     */
    public void setContact(String contact) {
        this.contact = contact;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getPhone() {
        return phone;
    }

    /**
     * Method description
     *
     *
     * @param phone
     */
    public void setPhone(String phone) {
        this.phone = phone;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getLotsize() {
        return lotsize;
    }

    /**
     * Method description
     *
     *
     * @param lotsize
     */
    public void setLotsize(String lotsize) {
        this.lotsize = lotsize;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getDeposit() {
        return deposit;
    }

    /**
     * Method description
     *
     *
     * @param deposit
     */
    public void setDeposit(String deposit) {
        this.deposit = deposit;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getBalance() {
        return balance;
    }

    /**
     * Method description
     *
     *
     * @param balance
     */
    public void setBalance(String balance) {
        this.balance = balance;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    @Override
    public int hashCode() {
        int hash = 0;

        hash += ((vendorid != null)
                 ? vendorid.hashCode()
                 : 0);

        return hash;
    }

    /**
     * Method description
     *
     *
     * @param object
     *
     * @return
     */
    @Override
    public boolean equals(Object object) {

        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Vendor)) {
            return false;
        }

        Vendor other = (Vendor) object;

        if (((this.vendorid == null) && (other.vendorid != null))
                || ((this.vendorid != null) &&!this.vendorid.equals(other.vendorid))) {
            return false;
        }

        return true;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    @Override
    public String toString() {
        return "showtest.Vendor[ vendorid=" + vendorid + " ]";
    }
}


//~ Formatted in DD Std on 13/08/13
